      Public Function MD5(ByVal str As String) As String
      Dim ASCIIenc As New ASCIIEncoding
      Dim strReturn
      Dim ByteSource() As Byte = ASCIIenc.GetBytes(str)
      Dim Md5Hash As New MD5CryptoServiceProvider
      Dim ByteHash() As Byte = Md5Hash.ComputeHash(ByteSource)
      For Each b As Byte In ByteHash
      strReturn &= b.ToString("x2")
      Next
      Return strReturn
      End Function